package arrays;

import java.util.Arrays;
import java.util.Scanner;

public class arrays_3 {
    public static void main (String [] args ){
        int number ;
        boolean flag = false ;
        int intarrays[] = new int[]{ 2, 9, 7 ,16 ,68};
        System.out.println( Arrays.toString(intarrays));
        Scanner scanner = new Scanner( System.in );
        System.out.println( " 请输入一个整数：" );
        number = scanner.nextInt();
        for (int i = 0; i < intarrays.length; i++) {
            if (number == intarrays[i]){
                flag = true ;
            }
        }
        if ( flag ){
            System.out.println( number + "在数组中.");
        }else {
            System.out.println( number + "不在数组中。");
        }

    }
}
